package com.bdqn.mapper;

import com.bdqn.pojo.HisPatient;
import com.bdqn.pojo.HisRegistration;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.context.annotation.Role;

public interface HisPatientMapper {
    @Select("SELECT * FROM his_patient WHERE id_card = #{idCard}")
    HisPatient selectidCardAll(String idCard);
    @Select("SELECT * FROM his_patient WHERE name = #{name}")
    HisPatient selectNameAll(String name);

    @Insert("INSERT INTO `his_patient` VALUES (#{patientId}, #{patientName}, #{phone}, #{age}, #{sex}, #{birthday}, #{idCard}, #{address}, #{allergyInfo}, #{isFinal}, #{password}, #{openid}, #{lastLoginIp}, #{lastLoginTime}, #{createTime}, #{updateTime})")
    int addHisPatient(HisPatient hisPatient);
    //接诊
    @Select("SELECT * FROM his_patient WHERE patient_id = #{id}")
    HisPatient receiveAPatientForTreatment(String id);
}
